<script lang="tsx">
import {defineComponent, PropType} from "vue"
import {ElSelect} from "element-plus"

export default defineComponent({
  name: "SelectInput",
  props: {
    data: {
      type: Array as PropType<Array<{ [key: string]: any }>>,
      required: true
    },
    clearable: {
      type: Boolean,
      default: false
    },
    valueKey: {
      type: String,
      default: "value"
    },
    labelKey: {
      type: String,
      default: "label"
    }
  },
  setup(props) {

  }
})
</script>
<template>
  <el-select class="select-input" v-bind="$attrs" :clearable>
    <el-option v-for="item in data" :key="item[valueKey]" :value="item[valueKey]" :label="item[labelKey]"/>
  </el-select>
</template>